package com.itheima.exception_learn;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class ExceptionLearn1 {
    public static void main(String[] args){

        System.out.println("捕获异常");
        try{
            m1();
        }catch(FileNotFoundException e){
            //打印异常堆栈信息
            e.printStackTrace(System.out);
        }

        System.out.println("异常被捕获，后面的程序正常进行。");
    }

    public static void m1() throws FileNotFoundException{
        m2();

    }

    private static void m2() throws FileNotFoundException{
        m3();
    }

    private static void m3() throws FileNotFoundException{
        //创建了一个输入流对象来测试
        try{
           new FileInputStream("uu.txt");
        }catch(FileNotFoundException e){
            throw e;
        }

    }


}
